package club.kingyin.easycache.key;

import java.io.Serializable;

public interface EasyCacheKey extends Serializable, Parser<String,EasyCacheKey>{

    String DEFAULT_MODULE = "ky-cache";

    boolean containsPramName(String pramName);

    boolean isEmptyByPramName(String pramName);

    String getMethodName();

    String getModule();

    String getKey();

    void setModule(String module);

    void setMethodName(String methodName);

    void setKey(String key);

    String getKeyWithPram(String... pramName);

    <T> T getPram(String name, Class<T> type);

    Object getPram(String name);

    Object getPrams();

    String prefix();

    default boolean equalsModuleANdMethodName(EasyCacheKey key) {
        return getModule().equals(key.getModule()) && getMethodName().equals(key.getMethodName());
    }

    boolean equalsPram(EasyCacheKey key, String... pramName);

    boolean minContainsPramByKeys(EasyCacheKey... key);

}
